<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>手风琴菜单</title>
    <script src="jquery.min.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
        }
        #container {
            width: 100px;
            margin: auto;
            margin-top: 50px;
        }
        .box div{
            width: 100px;
            height: 30px;
            font-size: 16px;
            font-weight: 800;
            background: skyblue;
            line-height: 30px;
            text-align: center;
            margin-bottom: 3px;
        }
        .sub li{
            width: 100px;
            height: 25px;
            font-size: 14px;
            background: cornsilk;
            border-bottom: 1px solid;
            line-height: 25px;
            list-style: none;
            text-align: center;
        }
        .sub {
            display: none;
        }
    </style>
</head>
<body>
    <div id="container">
        <ul class="box">
            <div>首页</div>
            <ul class="sub">
                <li>首页的二级</li>
                <li>首页的二级</li>
                <li>首页的二级</li>
                <li>首页的二级</li>
            </ul>
        </ul>
        <ul class="box">
            <div>新闻</div>
            <ul class="sub">
                <li>新闻的二级</li>
                <li>新闻的二级</li>
                <li>新闻的二级</li>
                <li>新闻的二级</li>
            </ul>
        </ul>
        <ul class="box">
            <div>咨询</div>
            <ul class="sub">
                <li>咨询的二级</li>
                <li>咨询的二级</li>
                <li>咨询的二级</li>
                <li>咨询的二级</li>
            </ul>
        </ul>
        <ul class="box">
            <div>体育</div>
            <ul class="sub">
                <li>体育的二级</li>
                <li>体育的二级</li>
                <li>体育的二级</li>
                <li>体育的二级</li>
            </ul>
        </ul>
    </div>
    <script>
        $(".box").hover(function () {
            $(this).children(".sub").stop().slideToggle();
        })
    </script>
</body>
</html>